$(function(){
	var addBooks=$("#add_button");
	var add1=$("#add1");
	var add2=$("#add2");
	var addform=$("#addbook_form");
	addBooks.click(function(){
		if(add1.val()==""){
			alert("请选择待添加书单a");
		}
		else if(add2.val()==""){
			alert("请选择待添加书单b");
		}
		else{
			addform.submit();
		}
	});
	
	
	
	var deleteBooks=$("#delete_button");
	var delete1=$("#delete1");
	var delete2=$("#delete2");
	var deleteform=$("#deletebook_form");
	deleteBooks.click(function(){
		if(delete1.val()==""){
			alert("请选择待删除书单a");
		}
		else if(delete2.val()==""){
			alert("请选择待删除书单b");
		}
		else{
			deleteform.submit();
		}
	});
	
	
	var addOne=$(".submit");
	var oneForm=$("#onebook_form");
	addOne.click(function(){
		if(  ($(".book_id").val()=="") || ($(".book_code").val()=="")|| ($(".book_name").val()=="") 
				|| ($(".writer").val()=="")|| ($(".publisher").val()=="")|| ($(".date").val()=="")
				|| ($(".type").val()=="")|| ($(".isTeacher").val()=="")|| ($(".location").val()=="")){
			alert("请输入未填的信息");
		}
		else{
			oneForm.submit();
		}
	});
});